Release 10.1A: OpenEdge Development:
.NET Open Clients


Passing INPUT parameters

Passing an INPUT parameter requires several steps to provide a value as input to an application service procedure or user-defined function.

To pass an INPUT parameter:

  1. Create and initialize a variable for the parameter of the correct .NET data type (see the "Creating variables for parameters" section).
  2. Add the parameter to a ParamArray object (see the "Setting up a parameter array" section).
  3. Run the procedure or user-defined function (see the "Running procedures and user-defined functions" section).

Example 8–3 passes an INPUT integer parameter that does not support the Unknown value (?):

Example 8–3: Passing an INPUT parameter using the .NET OpenAPI
// Define and initialize the variable for the input parameter 
Int32 CustomerNumber = 33; 
// Create the ParamArray 
ParamArray parms = new ParamArray(1); 
// Add the input parameter to the ParamArray 
parms.AddInteger (0, CustomerNumber, ParamArrayMode.INPUT); 
// Run the procedure or user-defined function 
... 

Example 8–4 passes an INPUT integer parameter that supports the Unknown value (?):

Example 8–4: INPUT parameter as Unknown value (?) using .NET OpenAPI
// Define and initialize the variable for the input parameter 
Int32 CustomerNumber = 33; 
... 
//Define and set the holder class for the input parameter  
//to null or an integer based on the variable value 
IntHolder hCustomerNumber = new IntHolder(); 
iCustomerNumber = new Integer(CustomerNumber) 
if (CustomerNumber > 33) 
   hCustomerNumber.Value = null; 
else 
   hCustomerNumber.Value = (Object) iCustomerNumber; 
// Create the ParamArray 
ParamArray parms = new ParamArray(1); 
// Add the input parameter to the ParamArray 
parms.AddInteger (0, hCustomerNumber, ParamArrayMode.INPUT); 
// Run the procedure or user-defined function 
... 


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095